package com.data.common.util.jsonschema.validate;

import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.data.common.system.vo.DictModel;
import com.data.common.util.jsonschema.CommonProperty;
import com.data.modules.online.config.executor.DataBaseConst;

public class StringProperty extends CommonProperty {

    private static final long f40l = -3200493311633999539L;

    private Integer f41m;

    private Integer f42n;

    private String f43o;

    private String f44p;

    public Integer getMaxLength() {
        return this.f41m;
    }

    public void setMaxLength(Integer maxLength) {
        this.f41m = maxLength;
    }

    public Integer getMinLength() {
        return this.f42n;
    }

    public void setMinLength(Integer minLength) {
        this.f42n = minLength;
    }

    public String getPattern() {
        return this.f43o;
    }

    public void setPattern(String pattern) {
        this.f43o = pattern;
    }

    public String getErrorInfo() {
        return this.f44p;
    }

    public void setErrorInfo(String errorInfo) {
        this.f44p = errorInfo;
    }

    public StringProperty() {
    }

    public StringProperty(String key, String title, String view, Integer maxLength) {
        this.f41m = maxLength;
        this.f1a = key;
        this.f5e = view;
        this.f6f = title;
        this.f2b = DataBaseConst.f474i;
    }

    public StringProperty(String key, String title, String view, Integer maxLength, List<DictModel> include) {
        this.f41m = maxLength;
        this.f1a = key;
        this.f5e = view;
        this.f6f = title;
        this.f2b = DataBaseConst.f474i;
        this.f3c = include;
    }

    @Override
    public Map<String, Object> getPropertyJson() {
        HashMap hashMap = new HashMap();
        hashMap.put("key", getKey());
        JSONObject commonJson = getCommonJson();
        if (this.f41m != null) {
            commonJson.put("maxLength", this.f41m);
        }
        if (this.f42n != null) {
            commonJson.put("minLength", this.f42n);
        }
        if (this.f43o != null) {
            commonJson.put("pattern", this.f43o);
        }
        if (this.f44p != null) {
            commonJson.put("errorInfo", this.f44p);
        }
        hashMap.put("prop", commonJson);
        return hashMap;
    }
}
